package com.ihisun.tmhcms.core.dao.userdao;

import com.ihisun.tmhcms.core.dto.userdto.VipLevelTotalDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface VipLevelTotalDao extends JpaRepository<VipLevelTotalDto,Long> {


    /*查询全部会员*/
    @Query(value = " select id,role, count(*) as Harmony  from u_user",nativeQuery = true)
    public List<VipLevelTotalDto> harmony();

    /*会员分别统计*/
    @Query(value = "select id,role, count(role)as Harmony from u_user GROUP BY role",nativeQuery = true)
    public List<VipLevelTotalDto> vipHarmony();

}
